<?php
/**
 * @desc
 * @author: jintao
 * @since: 2016/8/1
 */
class erpapi_shop_matrix_taobao_request_logistics extends erpapi_shop_request_logistics {

    public function updateReturnLogistics($reshipinfo) {
        $orderModel = app::get('ome')->model('orders');
        $order = $orderModel->dump($reshipinfo['order_id'], 'order_bn');
        $confirm_result = '1';
        if ($reshipinfo['is_check'] == '9') {
            $confirm_result = '2';
        }
        $reship_bn = $reshipinfo['reship_bn'];
        #取退货单上的
        $oReturn_tmall = app::get('ome')->model('return_product_tmall');
        $return_tmall = $oReturn_tmall->dump(array('return_bn'=>$reship_bn));
        $params['refund_id']        = $reshipinfo['reship_bn'];
        $params['refund_phase '] = $return_tmall['refund_phase'];
        $params['confirm_result '] = $confirm_result;
        $params['company_code']=$reshipinfo['return_logi_name'];
        $params['sid'] = $reshipinfo['return_logi_no'];
        $params['operator']=kernel::single('desktop_user')->get_name();;
        $params['confirm_time']=date('Y-m-d H:i:s',$reshipinfo['t_end']);
        $callback = array(
            'class' => get_class($this),
            'method' => 'callback',
        );
        $title = '店铺('.$this->__channelObj->channel['name'].')回填退回物流单号物流公司'.'(订单号:'.$order['order_bn'].'退货单号:'.$reshipinfo['reship_bn'].')';;
        $rs = $this->__caller->call(SHOP_REFUND_GOOD_RETURN_CHECK,$params,$callback,$title,10,$order['order_bn']);
        return $rs;
    }
}